<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue@2.7.16.js"></script>
    <title>键盘事件</title>
</head>

<body>
    <div id="app">
        键盘事件：<input type="text" @keydown.huiche="showinfo">
    </div>
</body>

<script>
    Vue.config.keyCodes.huiche = 13

    new Vue({
        el: "#app",
        data: {},
        methods: {
            showinfo() {
                alert("showinfo")
            }
        }
    })
</script>

</html>